﻿Public Class PrimMakbuzYazim : Inherits ProcessReport

	Dim makbuzno As Input

	Public Overrides Sub GenericEvent(ByVal e As ProcessEventArgs)
		Select Case e.EventType
			Case EventType.Initialize
				Start("Makbuz yazımı", "Makbuz numarasını girin.")
				makbuzno = AddField("makbuzno", "nl", "", "Makbuz numarasını girmeniz gerekir.")
				Landscape = True
			Case EventType.ValidateForm
				Rs = Prim.MakbuzDetayi(Remote, CurrentDepartment, makbuzno.Get)
				If Check("makbuzno", Rs.EOF, "Makbuz numarası bulunamadı.") Then Exit Sub
				e.Result = True
			Case EventType.PrintStarted
				e.Result = True
				Prim.MakbuzYaz(Remote, CurrentDepartment, makbuzno.Get)
			Case EventType.ReportDetail
				Report.SetColumns("", "1", "c")
				Report.Print("<++>K.K.T.C.")
				Report.Print("")
				Report.Print("SOSYAL SİGORTALAR DAİRESİ")
				Report.Print("PRİM TAHSİLAT MAKBUZU")
				Report.Print("")
				Report.BeginBorders()
				Report.SetColumns("", "1;1;1;1", "c;c;c;c")
				Report.Print("ŞUBE/BÜRO", "TARİH", "MAKBUZ NO.", "B.İ.M. NO.")
				Report.Indent = New Padding(8)
				Report.Print(Department.SubeAdi(CurrentDepartment), DMY(Rs("islemtar")), "", makbuzno.Get)
				Report.ResetIndent()
				Report.SetColumns("", "3;1;1;1", "c;c;c;c")
				Report.Print("İŞVERENİN VEYA İŞ SAHİBİNİN ADI/ÜNVANI", "SİGORTALI NO.", "KİMLİK NO.", "İŞYERİ SİCİL NO")
				Report.Indent = New Padding(8)
				Report.Print(Rs("isyeriadi"), Rs("sno"), Rs("kimlik"), Rs("sicilno"))
				Report.ResetIndent()
				Report.SetColumns("", "1;1;2;2;2;2;2", "c;c;c;c;c;c;c")
				Report.Print("DNM-AY/YIL", "BORDRO TİPİ", "TOPLAM P.E.K.", "PRİM", "GECİKME ZAMMI", "FAİZ", "TOPLAM")
				Report.Indent = New Padding(8)
				Report.Print(Rs("donem"), Rs("bordro"), Fm(Rs("pekt"), "TL"), Fm(Rs("primtahakkuk"), "TL"), Fm(Rs("geczam"), "TL"), Fm(Rs("faiz"), "TL"), Fm(Rs("tahsilatt"), "TL"))
				Report.SetColumns("", "1;11", "c;l")
				Report.Print("YALNIZ", "--- " & NumberToText(Rs("tahsilatt")) & " TL ---")
				Report.ResetIndent()
				Report.SetColumns("", "4;1;3", "c;c;c")
				Dim Emanet = ""
				Emanet = vbCrLf & vbCrLf & vbCrLf & vbCrLf & "Emanet no. : " & IsNull(Rs("tahsilno"), "-") & "   Emanet tarihi : " & IsNull(DMY(Rs("tahsiltar")), "-")
				Report.Print("<rs=5>" & Emanet, "HAZIRLAYAN", "TAHSİL EDİLMİŞTİR")
				Report.Indent = New Padding(22)
				Report.Print(User.UserName, "<rs=3>")
				Report.ResetIndent()
				Report.Print("KONTROL EDEN")
				Report.Indent = New Padding(20)
				Report.Print("<rs=2>")
				Report.ResetIndent()
				Report.Print("VEZNEDAR")
				Report.EndBorders()
		End Select
	End Sub

End Class
